package com.seisys.controller.system.menu;

import java.util.HashMap;
import java.util.Map;
import java.util.concurrent.TimeUnit;

import javax.servlet.http.HttpServletRequest;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.seisys.controller.base.BaseController;

@Controller
@RequestMapping(value = "/springTest")
public class SpringMvcController extends BaseController
{
    public Map<String,Object> hashMap = new HashMap<String,Object>();

    @RequestMapping(value="methodA")
    @ResponseBody
    public ResultBean<Map<String,Object>> methodA(String type) throws InterruptedException
    {
    	ResultBean<Map<String,Object>> res = new ResultBean<>();
    	hashMap.put("1", "张三");
    	if(type.equals("1"))
    	{
    		
    		TimeUnit.SECONDS.sleep(60);//设置等待60秒
    		return res;
    	}else
    	{
    		res.setCode(0);
    		res.setData(hashMap);
    		res.setMsg("操作成功！");
    		return res;
    	}
    	
    }
    
    @RequestMapping(value="methodB")
    @ResponseBody
    public Map<String,Object> methodB(HttpServletRequest request) throws InterruptedException
    {
    	hashMap.put("2", "李四");
    	hashMap.put("3", "王五");
    	return hashMap;
    	
    }
    
}
